import request from '@/utils/request'

/**
 * 添加收货地址信息
 * @param {Object} address - 地址对象
 */
export const insertAddressAPI = (addressForm) => request('/member/address', 'post', addressForm)

/**
 * 创建订单
 * @param {*} orderObj
 * @returns
 */
export const createOrderAPI = (orderObj) => {
  return request('/member/order', 'post', orderObj)
}

/**
 * 获取订单详情
 * @param {*} orderId
 */
export const getOrderInfoAPI = (orderId) => {
  return request(`/member/order/${orderId}`, 'get')
}

/**
 * 获取订单列表
 * @param {*} queryObj
 * @returns
 */
export const getOrderListAPI = (queryObj) => {
  return request('/member/order', 'get', queryObj)
}
